package com.zyasdk.service;

import android.content.Context;

import com.zyasdk.model.SDKActionRecord;
import com.zyasdk.util.AppInfoUtil;
import com.zyasdk.util.Base64;
import com.zyasdk.util.JSONHelper;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import java.util.ArrayList;
import java.util.List;

public class SDKActionRecordService extends BaseService {

	public SDKActionRecordService(Context context) {
		super(context);
	}

	public void AddSAR(SDKActionRecord sar) {
		sar.setPbindkey(getPBindKey());
		sar.setImei(AppInfoUtil.getIMEI(context));//Imei
		sar.setImsi(AppInfoUtil.getIMSI(context));//Imsi
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("SAR", new String(Base64.encode(JSONHelper
				.toJSON(sar).getBytes(), Base64.DEFAULT))));
		ServiceTask.addTask(GetAPIUrl("AddSAR"), params);
	}
	
	
}
